package buffered;

import java.io.*;
//字符缓冲流
public class BufferedReaderTest1 {
    public static void main(String[] args) throws IOException {
        method1();
        BufferedReader br=new BufferedReader(new FileReader("G:\\Javatest2\\output\\c.txt"));
        BufferedWriter bw=new BufferedWriter(new FileWriter("G:\\Javatest2\\buffered\\d.txt"));
        char[] chs=new char[1024];
        int len;
        while((len=br.read(chs))!=-1){
            bw.write(chs,0,len);
        }
        br.close();
        bw.close();
    }

    private static void method1() throws IOException {
        BufferedReader br=new BufferedReader(new FileReader("G:\\Javatest2\\output\\c.txt"));
        BufferedWriter bw=new BufferedWriter(new FileWriter("G:\\Javatest2\\buffered\\c.txt"));
        int i;
        while((i=br.read())!=-1){
            bw.write(i);
        }
        br.close();
        bw.close();
    }
}
